
package com.shop.cloud.mall.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 分销订单
 *
 * @author
 * @date 2021-04-30 10:26:30
 */
@Data
@TableName("distribution_order")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "分销订单")
public class DistributionOrder extends Model<DistributionOrder> {
    private static final long serialVersionUID=1L;

    /**
     * PK
     */
    @TableId(type = IdType.ASSIGN_ID)
    @NotNull(message = "PK不能为空")
    @Schema(description = "PK")
    private String id;
    /**
     * 所属租户
     */
    @NotNull(message = "所属租户不能为空")
    @Schema(description = "所属租户")
    private String tenantId;
    /**
     * 逻辑删除标记（0：显示；1：隐藏）
     */
    @NotNull(message = "逻辑删除标记（0：显示；1：隐藏）不能为空")
    @Schema(description = "逻辑删除标记（0：显示；1：隐藏）")
    private String delFlag;
    /**
     * 创建时间
     */
    @NotNull(message = "创建时间不能为空")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;
    /**
     * 最后更新时间
     */
    @NotNull(message = "最后更新时间不能为空")
    @Schema(description = "最后更新时间")
    private LocalDateTime updateTime;
    /**
     * 分销级别（1：一级分销；2：二级分销）
     */
    @NotNull(message = "分销级别（1：一级分销；2：二级分销）不能为空")
    @Schema(description = "分销级别（1：一级分销；2：二级分销）")
    private String distributionLevel;
    /**
     * 分销员ID
     */
    @NotNull(message = "分销员ID不能为空")
    @Schema(description = "分销员ID")
    private String distributionUserId;
    /**
     * 订单id
     */
    @NotNull(message = "订单id不能为空")
    @Schema(description = "订单id")
    private String orderId;
    /**
     * 店铺id
     */
    @Schema(description = "店铺id")
    private String shopId;
    /**
     * 用户id
     */
    @Schema(description = "用户id")
    private String userId;
    /**
     * 返佣金额
     */
    @NotNull(message = "返佣金额不能为空")
    @Schema(description = "返佣金额")
    private BigDecimal commission;
    /**
     * 佣金状态（1：冻结；2：解冻）
     */
    @NotNull(message = "佣金状态（1：冻结；2：解冻）不能为空")
    @Schema(description = "佣金状态（1：冻结；2：解冻）")
    private String commissionStatus;

	@TableField(exist = false)
	private UserInfo userInfo;

	@TableField(exist = false)
	private OrderInfo orderInfo;

    @TableField(exist = false)
    private DistributionUser distributionUser;

	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@TableField(exist = false)
	private LocalDateTime beginTime;

	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@TableField(exist = false)
	private LocalDateTime endTime;
}
